<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="../favicon.ico" />
    
    <title>Document</title>
  </head>

  <body>
    <!-- 引入顺序必须按照先引入核心库的顺序，否则报错  -->
    <div id="root"></div>
    <div id="dia" style="display: none;width: 300px;height: 200px;border: 0.5px solid salmon;margin-left: 50%;transform: translate(-50%,50%);">Dialoaaaag
    <div id = "exit" style="font-size: larger;font-weight: strong;color: tomato;margin-top: 50%;"> Close </div>
    </div>

    <script src="../js/react.development.js"></script>

    <!-- <script src="../js/prop-types.js"></script> 目前没什么用 -->
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
    // 创建函数式组件
    class MyComponent extends React.Component {
        render () {
            return (
                <div>
                    <h1>Hello,类组件（复杂组件）</h1>  
                </div>
            )
              
       
        }
    }
    // 渲染组件到页面
    ReactDOM.render(<MyComponent/>,document.getElementById('root'))
    var cl = document.getElementById('root')
    var log = document.getElementById('dia')
    var exit = document.getElementById('exit')
    exit.onclick = ()=> {
        DialogClose()
    }
    function DialogOpen() {
        dia.style.display = 'block'
    }
    function DialogClose() {
        dia.style.display = 'none'
    }
    cl.onclick = ()=> {
        if(log.style.display == 'none'){
            log.style.display = 'block'
        }
        else
        log.style.display = 'none'
    }

    </script>
  </body>
</html>
